package cn.jsj.dispose;

import java.io.IOException;
import java.io.PrintWriter;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
/**
 * 删除律师信息处理类
 * @author LI
 *
 */
public class DeleteLawyerInfo extends HttpServlet {

	public void doGet(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {
		// 调试信息
		cn.jsj.utils.SysLogger.PrintInfo("删除律师信息！！！！！！！");

		//获取要删除律师的ID
		int lawyerId=Integer.parseInt(request.getParameter("lawyerID"));

		//调试信息
		cn.jsj.utils.SysLogger.PrintInfo("获得的参数 lawyerId----->"+lawyerId);

		//删除律师信息
		 cn.jsj.dao.TblLawyerDAO tld=new cn.jsj.dao.TblLawyerDAO();
		int  deleteSuccess= tld.deleteLawyerInfo(lawyerId);

		//调试信息
		cn.jsj.utils.SysLogger.PrintInfo("删除结果是----------->"+deleteSuccess);

		//输出信息到客户端
		java.io.PrintWriter out=response.getWriter();
		if(deleteSuccess==1){
			out.println("{message:'删除成功！！！'}");
		}
		else{
			out.println("{message:'删除失败！！！'}");
		}
		out.flush();
		out.close();

	}

	public void doPost(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {
		doGet(request,response);
	}

}
